﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FrameworkDesign.Example;
using System;

public class Game : MonoBehaviour
{
    // Game在Unity Scene中是Enemies的父节点，所以可以直接 持有/引用 Enemies
    private void Awake()
    {
        GameStartEvent.Register(OnGameStart);
    }
    // OnGameStart()是给事件注册的【事件处理函数】（C#的事件是观察者模式）
    private void OnGameStart()
    {
        transform.Find("Enemies").gameObject.SetActive(true);
    }
    private void OnDestroy()
    {
        GameStartEvent.unRegister(OnGameStart);
    }
    
}
